<template>
  <view class="claim-container">
    <!-- 任务列表 -->
    <view class="task-list">
      <view 
        class="task-card" 
        v-for="(task, index) in taskList" 
        :key="task.id"
      >
        <view class="card-header">
          <view class="task-info">
            <text class="task-name">{{ task.name }}</text>
            <text class="task-number">编号：{{ task.number }}</text>
          </view>
          <view class="task-date">
            <text class="date-label">计划完成</text>
            <text class="date-value">{{ task.planDate }}</text>
          </view>
        </view>
        
        <view class="card-content">
          <view class="task-desc">
            <text class="desc-text">{{ task.description }}</text>
          </view>
        </view>
      </view>
    </view>
    
    <!-- 空状态 -->
    <view class="empty-state" v-if="taskList.length === 0">
      <uni-icons type="info" size="60" color="#ccc"></uni-icons>
      <text class="empty-text">暂无任务</text>
    </view>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        taskList: [
          {
            id: 1,
            name: '设备维护检查',
            number: 'TASK-2023-001',
            description: '对生产车间的主要设备进行定期维护检查，确保设备正常运行。',
            planDate: '2023-12-15'
          },
          {
            id: 2,
            name: '安全巡检任务',
            number: 'TASK-2023-002',
            description: '对厂区进行安全巡检，检查消防设施和安全标识。',
            planDate: '2023-12-18'
          },
          {
            id: 3,
            name: '库存盘点',
            number: 'TASK-2023-003',
            description: '对仓库原材料进行盘点，核对库存数量与系统记录。',
            planDate: '2023-12-20'
          },
          {
            id: 4,
            name: '设备校准',
            number: 'TASK-2023-004',
            description: '对测量设备进行校准，确保测量精度符合标准。',
            planDate: '2023-12-22'
          },
          {
            id: 5,
            name: '环境检测',
            number: 'TASK-2023-005',
            description: '对工作环境进行检测，包括噪音、温度、湿度等指标。',
            planDate: '2023-12-25'
          }
        ]
      }
    }
  }
</script>

<style lang="scss">
  .claim-container {
    padding: 20rpx;
    background-color: #f5f5f5;
    min-height: 100vh;
  }
  
  .task-list {
    margin-top: 20rpx;
  }
  
  .task-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16rpx;
    padding: 30rpx;
    margin-bottom: 20rpx;
    box-shadow: 0 8rpx 32rpx rgba(102, 126, 234, 0.2);
    position: relative;
    overflow: hidden;
    
    &::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 4rpx;
      background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    }
  }
  
  .card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20rpx;
  }
  
  .task-info {
    flex: 1;
    
    .task-name {
      display: block;
      font-size: 32rpx;
      font-weight: bold;
      color: #ffffff;
      margin-bottom: 8rpx;
      line-height: 1.4;
    }
    
    .task-number {
      display: block;
      font-size: 24rpx;
      color: rgba(255, 255, 255, 0.8);
    }
  }
  
  .task-date {
    text-align: right;
    
    .date-label {
      display: block;
      font-size: 22rpx;
      color: rgba(255, 255, 255, 0.7);
      margin-bottom: 4rpx;
    }
    
    .date-value {
      display: block;
      font-size: 26rpx;
      color: #ffffff;
      font-weight: 500;
    }
  }
  
  .card-content {
    .task-desc {
      .desc-text {
        font-size: 26rpx;
        color: rgba(255, 255, 255, 0.9);
        line-height: 1.5;
      }
    }
  }
  
  .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100rpx 0;
    
    .empty-text {
      margin-top: 20rpx;
      font-size: 28rpx;
      color: #999;
    }
  }
</style>
